package com.qianying.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 门店用户信息实体类，对应表：shop_user_info
 */
@Data
@TableName("shop_user_info")
@Schema(description = "门店用户信息实体，存储用户与公司、大区、门店的关联信息")
public class ShopUserInfo {

    @Schema(description = "主键ID，自增", example = "1")
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "关联sys_user表的id", example = "1001")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "关联customer_info表的id（所属公司ID）", example = "2001")
    @TableField("customer_id")
    private Long customerId;

    @TableField(exist = false)
    private String customerName;

    @Schema(description = "关联region表的id（所属大区ID）", example = "4001")
    @TableField("region_id")
    private Long regionId;

    @TableField(exist = false)
    private String regionName;

    @Schema(description = "关联shop_info表的id（所属门店ID）", example = "3001")
    @TableField("shop_id")
    private Long shopId;

    @TableField(exist = false)
    private String shopName;

    @Schema(description = "所在部门", example = "技术部")
    @TableField("department")
    private String department;

    @Schema(description = "职务", example = "工程师")
    @TableField("job")
    private String job;

    @Schema(description = "姓名", example = "张三")
    @TableField("real_name")
    private String realName;

    @Schema(description = "邮箱", example = "zhangsan@example.com")
    @TableField("email")
    private String email;

    @Schema(description = "创建时间", example = "2023-10-01 10:00:00")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "更新时间", example = "2023-10-01 15:30:00")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
